import java.util.Scanner;

public class DIVSUM1 {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		int testcases = in.nextInt();
		while (testcases-- > 0) {
			int number = in.nextInt();
			System.out.println(divisorSum(number));
		}
	}

	private static int divisorSum(int number) {
		int sum = 1;
		int numberSqrt = (int) Math.sqrt(number);
		if ((numberSqrt * numberSqrt) == number) {
			sum += numberSqrt;
			numberSqrt--;
		}
		if ((number % 2) != 0) {
			for (int i = 2; i <= numberSqrt; i++) {
				if ((number % i) == 0) {
					sum += i + (number / i);
				}
			}
		} else {
			for (int i = 2; i <= numberSqrt; i++) {
				if ((number % i) == 0) {
					sum += i + (number / i);
				}
			}
		}
		return sum;
	}
}
